package cn.ming.leo.resource.manager;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import cn.ming.leo.bean.Door;
import cn.ming.leo.service.DoorService;
import cn.ming.leo.utils.Message;
import cn.ming.leo.utils.PageListModel;

@RestController
@RequestMapping("/m/door")
public class MDoorResource {

	@Autowired
	private DoorService doorService;

	@RequestMapping(value = "/view", method = RequestMethod.GET)
	public Message<Door> getById(int id) {
		return doorService.getById(id);
	}

	@RequestMapping(value = "/findAll", method = RequestMethod.GET)
	public Message<PageListModel<Door>> findAll(Integer pageIndex, Integer pageSize) {
		return doorService.findAll(pageIndex, pageSize);
	}


}
